import api from './index'
// axios
import request from '@/utils/request'

// 登录
export function login(data) {
  return request({
    url: api.Login,
    method: 'post',
    data
  })
}

// 用户信息 post 方法
export function _getUserInfo(data) {
  return request({
    url: api.UserInfo,
    method: 'post',
    data,
    hideloading: true
  })
}

// 用户名称 get 方法
export function getUserName(params) {
  return request({
    url: api.UserName,
    method: 'get',
    params,
    hideloading: true
  })
}

// // 获取用户信息
// export function getUserInfo(params) {
//   return request({
//     // url: '/api_ckf/lctb_ckf/user/myInfo',
//     url: '/api_ckf/lctb_ckf/userbase/myInfo',
//     method: 'get',
//     params,
//     hideloading: true
//   })
// }


// 获取h5用户信息
export function getH5UserInfo() {
  return request({
    url: '/api_ckf/lctb_ckf/userbase/myInfo',
    method: 'get',
    hideloading: true
  })
}

// 编辑用户信息
export function editUserInfo(params) {
  return request({
    url: '/api_ckf/lctb_ckf/userbase/myInfo',
    method: 'put',
    data: params,
    hideloading: true
  })
}

// 上传图片的接口
export function uploadCard(params) {
  return request({
    url: '/api_ckf/lctb_ckf/files/upload',
    method: 'post',
    data: params,
    hideloading: true
  })
}
export function uploadH5Avatar(params) {
  return request({
    url: '/api_ckf/lctb_ckf/files/uploadH5Avatar',
    method: 'post',
    data: params,
    hideloading: true
  })
}

// 提交图片去审核的接口

export function uploadCardUrl(params) {
  return request({
    url: '/api_ckf/lctb_ckf/files/cardAuth',
    method: 'post',
    data: params,
    hideloading: true
  })
}

// 获取图片详情的接口
export function getCardPath(params) {
  return request({
    url: '/api_ckf/lctb_ckf/files/getMyInfo',
    method: 'get',
    params,
    hideloading: true
  })
}

// 获取身份证类型字典
export function getCardType(params) {
  return request({
    url: '/api_ckf/lctb_ckf/dict/ckf_card_type',
    method: 'get',
    params,
    hideloading: true
  })
}

// 提交邀请码认证
export function uploadInviter(params) {
  return request({
    url: '/api_ckf/lctb_ckf/userbase/inviter',
    method: 'post',
    data: params,
    hideloading: true
  })
}